#include <stdio.h>
int NarcissisticNum(int x);
int main(void)
{
    int a=100;
    NarcissisticNum(a);
    return 0;
}

int NarcissisticNum(int x)
{
	if(x>=1000) return 0;
    int g,s,b;
    g=x%10;
    s=(x%100-g)/10;
    b=(x-g-s)/100;
    if(x==g*g*g+s*s*s+b*b*b){
    printf("%5d",x);
    NarcissisticNum(x+1);}
    else NarcissisticNum(x+1);
}
